#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    bool isAnagram(string s, string t) {
        int hash1[26], hash2[26];
        for (auto e : s)hash1[e - 'a']++;
        for (auto e : t)hash2[e - 'a']++;
        for (int i = 0; i < 26; i++)if (hash1[i] != hash2[i])return false;
        return true;
    }
};